fix: reconcile cloud remote approval scopes#1313
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Greptile SummaryThis PR updates Guard Cloud remote approval handling for local queue and headless daemon flows. The main changes are:
Confidence Score: 4/5Safe to merge after fixing the invalid decision handling in the headless The command executor scope reconciliation is focused and covered by tests. One contained approval-flow bug remains in the daemon path.
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Cloud as Guard Cloud
participant Daemon as Headless daemon / Command executor
participant Store as GuardStore
Cloud->>Daemon: signed remote approval envelope
Daemon->>Store: get_approval_request(request_id)
Store-->>Daemon: pending request with policy_action + recommended_scope
Daemon->>Daemon: validate signature, binding, action, and scope
Daemon->>Store: claim_remote_once_receipt(receipt_id)
Daemon->>Store: "resolve_request_with_signed_remote_result(scope = recommended_scope)"
Store-->>Daemon: resolved_request
Daemon-->>Cloud: completed / not_resolved
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Cloud as Guard Cloud
participant Daemon as Headless daemon / Command executor
participant Store as GuardStore
Cloud->>Daemon: signed remote approval envelope
Daemon->>Store: get_approval_request(request_id)
Store-->>Daemon: pending request with policy_action + recommended_scope
Daemon->>Daemon: validate signature, binding, action, and scope
Daemon->>Store: claim_remote_once_receipt(receipt_id)
Daemon->>Store: "resolve_request_with_signed_remote_result(scope = recommended_scope)"
Store-->>Daemon: resolved_request
Daemon-->>Cloud: completed / not_resolved
|
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
Files Reviewed (6 files)
Fix these issues in Kilo Cloud Previous Review Summary (commit d529f62)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d529f62)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 3394aee)Status: Issues Found | Recommendation: Address before merge The previous WARNING about unconstrained recommended_scope in command_executors.py has been addressed in this commit by adding validation at lines 323-329. Reviewed by laguna-m.1-20260312:free · Input: 147.3K · Output: 12.1K · Cached: 674.8K |
d529f62 to
3394aee
Compare
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
3394aee to
26e87cd
Compare
Summary
Verification
python3 -m ruff check src/codex_plugin_scanner/guard/runtime/command_executors.py src/codex_plugin_scanner/guard/daemon/server.py tests/test_guard_command_queue.pypython3 -m pytest tests/test_guard_command_queue.py::test_executor_resolves_one_time_scope_with_allow tests/test_guard_command_queue.py::test_executor_resolves_one_time_scope_with_block -vpython3 -m py_compile src/codex_plugin_scanner/guard/runtime/command_executors.py src/codex_plugin_scanner/guard/daemon/server.py